﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern01单例模式
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Counter counter1 = Counter.Singleton;
            //Counter counter2 = Counter.Singleton;

            
            for (int i = 0;i < 1000; i++)
            {
                Task.Factory.StartNew(() =>
                {
                    Counter counter1 = Counter.LazyInstance;
                    Counter counter2 = Counter.LazyInstance;
                });
            }
           

            Console.ReadKey();
        }
    }
}
